<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<form name="addDataForm" id="addDataForm" method="post" action="/comm-schedule-server/task/save">
	<input type="hidden" name="id" id="input_id">
	<table class="infoTable">
		<tbody>
		<tr>
			<th align="right" width="10%">所属系统</th>
			<td><input id="inputSysCodeCombobox" name="sysCode" class="easyui-combobox" style="width:200px" data-options="panelHeight:'auto',onSelect:function(sys){$('#inputSysCodeName').val(sys.name);}" required="true"/>
			</td>
			<th align="right" width="10%">任务编码</th>
			<td><input type="text" id="inputTaskCodeText" name="code" class="easyui-validatebox" maxlength="25" size="15" required="true"></input>
			<font color="red">注：唯一性标识，格式：项目编码_任务编码</font>
			</td>
		</tr>
		<tr>
			<th align="right" width="10%">任务名称</th>
			<td><input type="text" id="inputTaskNameText" name="name" class="easyui-validatebox" style="width:200px" maxlength="50" size="20" required="true"></input>
			</td>
			<th align="right" width="10%">任务配置</th>
			<td><input type="text" id="inputTaskConfText" name="conf" class="easyui-validatebox" style="width:200px" maxlength="50" size="20" required="true"></input>
			</td>
		</tr>
		<tr>
			<th align="right" width="10%">任务接口</th>
			<td colspan="3"><input type="text" id="inputProceedMethodText" name="proceedMethod" class="easyui-validatebox" style="width:700px" maxlength="300" size="20" required="true"></input>
			</td>
		</tr>
		<tr>
			<th align="right" width="10%">备注</th>
			<td colspan="3"><textarea rows="3" style="width: 700px;" id="remark" name="remark" onkeyup="checkLength('remarkError',50,'remark')"></textarea>
				<font color="red"><br />注：50个字符以内，还可以输入<span class="input_font" id="remarkError">50</span>个字符</font>
			</td>
		</tr>
		</tbody>
	</table>
</form>
<script type="text/javascript">
	$.getJSON('/comm-dictionary-server/dictionary/findDictionaryByParentValue?sysCode=common&parentValue=sys_code',function(jsonData){
		$('#inputSysCodeCombobox').combobox({
			data:jsonData.data,
			valueField:'value',
			textField:'name'
		});
		if(selId != undefined){
			$.ajax({
				type: "get",
				url:  '/comm-schedule-server/task/getTask/' + selId,
				async : false,
				success: function(data,res){
					if (data.success) {
						var task = data.data;
						$('#input_id').val(task.id);
						$('#inputSysCodeCombobox').combobox('setValue',task.sysCode);
						$('#inputTaskCodeText').val(task.code);
						$('#inputTaskNameText').val(task.name);
						$('#inputTaskConfText').val(task.conf);
						$('#inputProceedMethodText').val(task.proceedMethod);
						$('#remark').val(task.remark);
					}
				},
				error: function(res){
					$.messager.alert('提示',i18n.requestError,'error');
				}
			});
		}
	});
	
</script>